<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2 {
            text-align: center;
        }

        table {
            /* 合并相邻边框 */
            border-collapse: collapse;
            height: 80px;
            margin: 0 auto;
            text-align: center;
        }

        th {
            padding: 5px 30px;
        }

        table,
        th,
        td {
            border: 1px solid #000;
        }
    </style>
</head>


<body>
    <h2>订单确认</h2>
    <script>
        let price = +prompt('请输入价格')
        let quantity = +prompt('请输入数量')
        let site = prompt('请输入收货地址')

        // 计算总价
        let sum = price * quantity

        // 页面输出

        document.write(`
     <table>
        <tr>
            <th>商品价格</th>
            <th>商品数量</th>
            <th>商品金额</th>
            <th>商品地址</th>
        </tr>
        <tr>
            <td>${price}</td>
            <td>${quantity}</td>
            <td>${sum}</td>
            <td>${site}</td>
        </tr>
    </table>
        `)
    </script>
</body>

</html>